cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(recipe14_boost CXX)

find_package(Boost REQUIRED COMPONENTS system filesystem)

if (Boost_FOUND)
    message(STATUS "Boost 库已找到")
    message(STATUS "Boost include 目录: ${Boost_INCLUDE_DIRS}")
    message(STATUS "Boost 库文件: ${Boost_LIBRARIES}")
    # 添加头文件搜索路径
    include_directories(${Boost_INCLUDE_DIRS})
    # 添加一个可执行文件
    add_executable(BoostExample main.cpp)
    # 链接 Boost 库
    target_link_libraries(BoostExample ${Boost_LIBRARIES})
else()
    message(FATAL_ERROR "Boost 库未找到")
endif()